package sd.qd.xiaoming.coffeedesk.dao;

import java.util.List;

import javax.persistence.TypedQuery;

import org.springframework.stereotype.Repository;

import sd.qd.xiaoming.coffeedesk.entity.CdDirectory;
import sd.qd.xiaoming.coffeedesk.entity.CdFile;

@Repository
public class CdFileDAO extends BaseDAO<CdFile> {

	public CdFileDAO() {
		super(CdFile.class);
	}

    public List<CdFile> findByDirectory(final CdDirectory directory) {
        TypedQuery<CdFile> query = this.entityManager.createQuery(
                "select f from CdFile f where f.directory=:directory",
                CdFile.class);
        query.setParameter("directory", directory);
        return query.getResultList();
    }


}
